DEFINITION MODULE QuickDraw;

  FROM SYSTEM IMPORT ADDRESS, BYTE;

  TYPE
    Ptr       = ADDRESS;
    Handle    = POINTER TO ADDRESS;
    VHSelect  = (V, H);
    Point     = RECORD
                  CASE :INTEGER OF
                    0: v, h: INTEGER;
                  | 1: vh:   ARRAY [V..H] OF INTEGER;
                  END;
                END;
    Rect      = RECORD
                  CASE :INTEGER OF
                    0: top, left, bottom, right: INTEGER;
                  | 1: topLeft, botRight:        Point;
                  END;
                END;
    BitMap    = RECORD
                  baseAddr: Ptr;
                  rowBytes: INTEGER;
                  bounds:   Rect;
                END;
    Pattern   = ARRAY [0..7] OF BYTE;
    StyleItem = (bold, italic, underline, outline, shadow, condense, extend);
    Style     = SET OF StyleItem;
    Bits16    = ARRAY [0..15] OF CARDINAL;
    Cursor    = RECORD data, mask: Bits16; hotSpot: Point END;
    GrafPtr   = POINTER TO GrafPort;
    GrafPort  = RECORD
                  device:                     INTEGER;
                  portBits:                   BitMap;
                  portRect:                   Rect;
                  visRgn, clipRgn:            Handle;
                  bkPat, fillPat:             Pattern;
                  pnLoc, pnSize:              Point;
                  pnMode:                     INTEGER;
                  pnPat:                      Pattern;
                  pnVis, txFont:              INTEGER;
                  txFace:                     Style;
                  txMode, txSize:             INTEGER;
                  spExtra, fgColor, bkColor:  LONGINT;
                  colrBit, patStretch:        INTEGER;
                  picSave, rgnSave, polySave: Handle;
                  grafProcs:                  Ptr;
                END;

  PROCEDURE GetPort(VAR port: GrafPtr); CODE 0A874H;
  PROCEDURE SetPort(newPort: GrafPtr); CODE 0A873H;
  PROCEDURE SetOrigin(h, v: INTEGER); CODE 0A878H;
  PROCEDURE Random(): INTEGER; CODE 0A861H;
  PROCEDURE SetRect(VAR r: Rect; left, top, right, bottom: INTEGER); CODE 0A8A7H;
  PROCEDURE Pt2Rect(pt1, pt2: Point; VAR rect: Rect); CODE 0A8ACH;
  PROCEDURE OffsetRect(VAR r: Rect; dh, dv: INTEGER);   CODE 0A8A8H;
  PROCEDURE InsetRect(VAR r: Rect; dh, dv: INTEGER);    CODE 0A8A9H;
  PROCEDURE PaintRect(VAR r: Rect); CODE 0A8A2H;
  PROCEDURE EraseRect(VAR r: Rect); CODE 0A8A3H;
  PROCEDURE InvertRect(VAR r: Rect); CODE 0A8A4H;

END QuickDraw.
